package bit.lotterysystem.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ActivityPrizeTiersEnum {

    FIRST_PRIZE(1,"一等奖"),
    SECOND_PRIZE(2,"二等奖"),
    THIRD_PRIZE(3,"三等奖");


    private final Integer code;

    private final String message;

    public static ActivityPrizeTiersEnum forName(String name) {
        for(ActivityPrizeTiersEnum activityPrizeTiersEnum : ActivityPrizeTiersEnum.values()) {
//            System.out.println(name);
//            System.out.println(activityPrizeTiersEnum);
//            System.out.println(ActivityPrizeTiersEnum.values());
            if(activityPrizeTiersEnum.name().equalsIgnoreCase(name)) {//.name()方法是获取枚举的名称，.message()是获取枚举的描述
                return activityPrizeTiersEnum;
            }
        }
        return null;
    }
}
